de.cebis.moccapart.calendar.domain
Class CalendarEvent

java.lang.Object
  extended by de.cebis.moccabox.domain.AbstractConceptualObject
      extended by de.cebis.moccapart.calendar.domain.CalendarComponent
          extended by de.cebis.moccapart.calendar.domain.CalendarEvent
All Implemented Interfaces:
IPersistentConcept, java.io.Serializable

public class CalendarEvent
extends CalendarComponent
implements java.io.Serializable

Object representing an CalendarEvent.
The CalendarEvent-object encapsulates different methods, to store and retrieve the different attributes of a calendar component.
The CalendarEvent does not necessarily have to represent an object stored in the database, but can be instantiated with an EventSource-object as well.

Version:
0
Author:
Christian Weichelt
See Also:
Serialized Form

Field Summary
static int CANCEL
          The CalendarEntry is a cancel of a request.
static java.lang.String PROP_ALLDAY
           
static java.lang.String PROP_DURATIONINHOURS
           
static java.lang.String PROP_DURATIONTEXT
           
static java.lang.String PROP_END
           
static java.lang.String PROP_ENDTIME
           
static java.lang.String PROP_INVITED
           
static java.lang.String PROP_METHOD
           
static java.lang.String PROP_RECURRENCEID
           
static int PUBLISH
          The CalendarEntry is a publish.
static int REPLY
          The CalendarEntry is a reply to a request.
static int REQUEST
          The CalendarEntry is a request.
 
Fields inherited from class de.cebis.moccapart.calendar.domain.CalendarComponent
NO_RIGHTS, NO_STATUS, OPAQUE, PROP_CALENDAR, PROP_CALENDARCOMPONENTCATEGORY, PROP_CLASSIFICATION, PROP_COMMENT, PROP_DESCRIPTION, PROP_DURATION, PROP_EDITABLE, PROP_LOCATION, PROP_MOVEABLE, PROP_ORGANISER, PROP_RELATEDCONCEPT, PROP_SEARCHFIELD, PROP_START, PROP_STARTTIME, PROP_STATUS, PROP_SUMMARY, PROP_TRANSPARENCY, READ, STATUS_CANCELLED, STATUS_CONFIRMED, STATUS_TENTATIVE, TIME_ONLY, TRANSPARENT, WRITE
 
Fields inherited from interface de.cebis.moccabox.domain.IPersistentConcept
PROP_CREATION_DATE, PROP_ID, PROP_LAST_EDIT_DATE, PROP_LAST_EDIT_USER
 
Constructor Summary
CalendarEvent()
           
CalendarEvent(java.lang.Long _iD)
          Constructor for primary key
 
Method Summary
 int calculateDuration()
          Calculates the length of the event in days.
 void copyAttributeValues(CalendarEvent event)
          Copies the attribute values from another CalendarEvent object.
 boolean getAllDay()
          Returns if the CalendarEntry is an all-day event.
 CalendarEvent getCalendarEvent()
           
 double getDurationInHours()
          Returns the duration of the event in hours and minutes.
 java.lang.String getDurationText()
          Returns the duration of the event in hours and minutes.
 java.util.Date getEnd()
          Returns the end date and time of the CalendarEntry.
 java.lang.String getEndText()
          Returns a text formatted date.
 java.lang.String getEndTime()
          Returns the end time of the CalendarEntry.
 boolean getInvited()
          Returns if the current user is only invited to the event.
 int getMethod()
          Returns the special method the CalendarEvent can be used to.
 java.lang.String getRecurrenceID()
          Returns the recurrence id of the CalendarEvent.
 java.lang.String getStartTime()
          Returns the starting time of the CalendarEntry.
 boolean isRecurring()
          Returns if the CalendarEvent object is part of a series of recurring CalendarEvent objects.
 void setAllDay(boolean allday)
          Sets if the CalendarEntry is an all-day event.
 void setDuration(java.lang.String duration)
          Sets the duration of the CalendarEvent in hours.
 void setDurationInHours(double hours)
          Sets the hours of duration as double value.
 void setEnd(java.util.Date end)
          Sets the end date and time of the CalendarEntry.
 void setEndTime(java.lang.String endTime)
          Sets the end time of the CalendarEntry.
 void setInvited(boolean invited)
          Sets if the current user is only invited to the event.
 void setMethod(int method)
          Sets the special method the CalendarEvent is used to.
 void setRecurrenceID(java.lang.String recurrenceid)
          Sets the recurrence id of the CalendarEvent.
 void setStart(java.util.Date start)
          Sets the starting date and time of the CalendarComponent.
 void setStartTime(java.lang.String start)
          Sets the starting date and time of the CalendarComponent.
 
Methods inherited from class de.cebis.moccapart.calendar.domain.CalendarComponent
getCalendar, getCategory, getClassification, getComment, getDescription, getDuration, getLocation, getOrganiser, getRelatedConcept, getSearchField, getStart, getStartText, getStarttime, getStatus, getSummary, getTransp, getTransparency, isEditable, isMoveable, setCalendar, setCategory, setClassification, setComment, setDescription, setEditable, setLocation, setMoveable, setOrganiser, setRelatedConcept, setSearchField, setStarttime, setStatus, setSummary, setTransp, setTransparency
 
Methods inherited from class de.cebis.moccabox.domain.AbstractConceptualObject
getCreationDate, getId, getLastEditDate, getVersion, setCreationDate, setId, setLastEditDate, setVersion
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQUEST

public static final int REQUEST
The CalendarEntry is a request.

See Also:
Constant Field Values

REPLY

public static final int REPLY
The CalendarEntry is a reply to a request.

See Also:
Constant Field Values

PUBLISH

public static final int PUBLISH
The CalendarEntry is a publish.

See Also:
Constant Field Values

CANCEL

public static final int CANCEL
The CalendarEntry is a cancel of a request.

See Also:
Constant Field Values

PROP_ALLDAY

public static final java.lang.String PROP_ALLDAY
See Also:
Constant Field Values

PROP_DURATIONINHOURS

public static final java.lang.String PROP_DURATIONINHOURS
See Also:
Constant Field Values

PROP_DURATIONTEXT

public static final java.lang.String PROP_DURATIONTEXT
See Also:
Constant Field Values

PROP_END

public static final java.lang.String PROP_END
See Also:
Constant Field Values

PROP_ENDTIME

public static final java.lang.String PROP_ENDTIME
See Also:
Constant Field Values

PROP_INVITED

public static final java.lang.String PROP_INVITED
See Also:
Constant Field Values

PROP_METHOD

public static final java.lang.String PROP_METHOD
See Also:
Constant Field Values

PROP_RECURRENCEID

public static final java.lang.String PROP_RECURRENCEID
See Also:
Constant Field Values
Constructor Detail

CalendarEvent

public CalendarEvent()

CalendarEvent

public CalendarEvent(java.lang.Long _iD)
Constructor for primary key

Method Detail

getCalendarEvent

public CalendarEvent getCalendarEvent()

setStart

public void setStart(java.util.Date start)
Sets the starting date and time of the CalendarComponent.

Overrides:
setStart in class CalendarComponent
Parameters:
start - Date and time that the entry starts.

setStartTime

public void setStartTime(java.lang.String start)
Sets the starting date and time of the CalendarComponent.

Overrides:
setStartTime in class CalendarComponent
Parameters:
start - Date and time that the entry starts.

getMethod

public int getMethod()
Returns the special method the CalendarEvent can be used to.

Returns:
Method, the CalendarEvent is used to. REQUEST, REPLY, PUBLISH, CANCEL.

setMethod

public void setMethod(int method)
Sets the special method the CalendarEvent is used to.

Parameters:
method - Method, the CalendarEvent is used to. REQUEST, REPLY, PUBLISH, CANCEL.

getRecurrenceID

public java.lang.String getRecurrenceID()
Returns the recurrence id of the CalendarEvent.

Returns:
The Recurrence ID for the CalendarEvent. Null, if CalendarEvent is a single event.

setRecurrenceID

public void setRecurrenceID(java.lang.String recurrenceid)
Sets the recurrence id of the CalendarEvent.

Parameters:
recurrenceid - The Recurrence ID for the CalendarEvent.

getStartTime

public java.lang.String getStartTime()
Returns the starting time of the CalendarEntry.

Overrides:
getStartTime in class CalendarComponent
Returns:
Time that the entry starts.

getEnd

public java.util.Date getEnd()
Returns the end date and time of the CalendarEntry.

Returns:
Date and time that the entry starts.

getEndText

public java.lang.String getEndText()
Returns a text formatted date.

Returns:
The End date formatted as text.

setEnd

public void setEnd(java.util.Date end)
Sets the end date and time of the CalendarEntry.

Parameters:
end - Date and time that the entry starts.

setDuration

public void setDuration(java.lang.String duration)
Sets the duration of the CalendarEvent in hours. Example: P1Y2M3DT4H30M12S means the duration of the enty is of 1 year, 2 months, 3 days, 4 hours, 30 minutes and 12 seconds.

Overrides:
setDuration in class CalendarComponent
Parameters:
duration - Duration of the CalendarComponent.

getDurationText

public java.lang.String getDurationText()
Returns the duration of the event in hours and minutes.

Returns:
Duration as String in the format 3h 20min

setDurationInHours

public void setDurationInHours(double hours)
Sets the hours of duration as double value.

Parameters:
hours - The hours of duration of the CalendarEvent

getDurationInHours

public double getDurationInHours()
Returns the duration of the event in hours and minutes.

Returns:
Duration as String in the format 3h 20min

getEndTime

public java.lang.String getEndTime()
Returns the end time of the CalendarEntry.

Returns:
Time that the entry starts.

setEndTime

public void setEndTime(java.lang.String endTime)
Sets the end time of the CalendarEntry.

Parameters:
endTime - Time that the entry starts.

getAllDay

public boolean getAllDay()
Returns if the CalendarEntry is an all-day event.

Returns:
True, if the entry is all-day. False, otherwise.

setAllDay

public void setAllDay(boolean allday)
Sets if the CalendarEntry is an all-day event.

Parameters:
allday - True, if the entry is all-day. False, otherwise.

calculateDuration

public int calculateDuration()
Calculates the length of the event in days.

Returns:
Duration in days.

setInvited

public void setInvited(boolean invited)
Sets if the current user is only invited to the event.

Parameters:
invited - True, if the user has been invited. False, if itīs an event thatīs in one of his calendars.

getInvited

public boolean getInvited()
Returns if the current user is only invited to the event.

Returns:
True, if the user has been invited. False, if itīs an event thatīs in one of his calendars.

isRecurring

public boolean isRecurring()
Returns if the CalendarEvent object is part of a series of recurring CalendarEvent objects.

Returns:
True, if itīs an recurring event. False, otherwise.

copyAttributeValues

public void copyAttributeValues(CalendarEvent event)
Copies the attribute values from another CalendarEvent object. If itīs a recurring CalendarEvent, the date will not be overwritten.

Parameters:
event - The source object from which the attribute values shall be copied.